summary: delete summary.sig on an update
authorGiuseppe Scrivano <gscrivan@redhat.com>
Mon, 4 May 2015 09:05:23 +0000 (11:05 +0200)
committerGiuseppe Scrivano <gscrivan@redhat.com>
Thu, 7 May 2015 19:58:04 +0000 (21:58 +0200)
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
src/libostree/ostree-repo.c
tests/test-auto-summary.sh

index c0313fe85fd252f4f807bd85624fe37c942efad8..4d8a73351ddfac7f1e43bb393efc4d6291acbc8f 100644 (file)
@@ -3704,6 +3704,15 @@ ostree_repo_regenerate_summary (OstreeRepo     *self,
                                            error))
     goto out;
 
+  if (unlinkat (self->repo_dir_fd, "summary.sig", 0) < 0)
+    {
+      if (errno != ENOENT)
+        {
+          gs_set_error_from_errno (error, errno);
+          goto out;
+        }
+    }
+
   ret = TRUE;
  out:
   if (ordered_keys)
index 0998b1e02bac782c5cf7e030302f85371bfc8109..2452e553ae0767e9cecab6c6956fe638439e6570 100755 (executable)
@@ -53,3 +53,8 @@ ${CMD_PREFIX} $OSTREE commit -b test -s "Another commit..." test
 echo "ok commit 3"
 
 assert_not_streq "$OLD_MD5" "$(md5sum repo/summary)"
+
+# Check that summary --update deletes the .sig file
+touch repo/summary.sig
+${CMD_PREFIX} $OSTREE summary --update
+assert_not_has_file repo/summary.sig